package com.nimitz.modules.approval.service.impl;


import com.nimitz.modules.approval.domain.ApprovalProcedureProcess;
import com.nimitz.modules.approval.mapper.ApprovalProcedureProcessMapper;
import com.nimitz.modules.approval.service.IApprovalProcedureProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ApprovalProcedureProcessServiceImpl
 * @Author FuCun
 * @Date 2021-08-17-14:45
 * @PackageName com.nimitz.modules.approval.service.impl
 * @Description 审批流线程-实现
 * @Version 1.0.0
 */
@Service
public class ApprovalProcedureProcessServiceImpl  implements IApprovalProcedureProcessService {

    @Autowired
    private ApprovalProcedureProcessMapper approvalProcedureProcessMapper;
    /**
     * 查询所有审批流线程（含搜索）
     *
     * @param  approvalProcedureProcess 审批流线程
     * @return 审批意见集合
     */
    @Override
    public List<ApprovalProcedureProcess> selectApprovalProcedureProcessList(ApprovalProcedureProcess approvalProcedureProcess) {
        return approvalProcedureProcessMapper.selectApprovalProcedureProcessList(approvalProcedureProcess);
    }

    /**
     * 新增审批流线程
     *
     * @param approvalProcedureProcess 审批流线程
     * @return 结果
     */
    @Override
    public int insertApprovalProcedureProcess(ApprovalProcedureProcess approvalProcedureProcess) {
        return approvalProcedureProcessMapper.insertApprovalProcedureProcess(approvalProcedureProcess);
    }

    /**
     * 修改审批流线程
     *
     * @param approvalProcedureProcess 审批流线程
     * @return 结果
     */
    @Override
    public int updateApprovalProcedureProcess(ApprovalProcedureProcess approvalProcedureProcess) {
        return approvalProcedureProcessMapper.updateApprovalProcedureProcess(approvalProcedureProcess);
    }

    /**
     * 删除审批流线程
     *
     * @param procedureProcessId 审批流节点id
     * @return 结果
     */
    @Override
    public int deleteApprovalProcedureProcessByProcedureProcessId(Long procedureProcessId) {
        return approvalProcedureProcessMapper.deleteApprovalProcedureProcessByProcedureProcessId(procedureProcessId);
    }

    /**
     * 校验审批流编号是否唯一
     *
     * @param procedureNo 审批流编号
     * @return 结果
     */
    @Override
    public ApprovalProcedureProcess checkApprovalProcedureNoUnique(Long procedureNo) {
        return approvalProcedureProcessMapper.checkApprovalProcedureNoUnique(procedureNo);
    }
}
